<?php



class FoodMapBuilder {

	
	const CLASS_NAME = 'lib.model.map.FoodMapBuilder';

	
	private $dbMap;

	
	public function isBuilt()
	{
		return ($this->dbMap !== null);
	}

	
	public function getDatabaseMap()
	{
		return $this->dbMap;
	}

	
	public function doBuild()
	{
		$this->dbMap = Propel::getDatabaseMap('propel');

		$tMap = $this->dbMap->addTable('food');
		$tMap->setPhpName('Food');

		$tMap->setUseIdGenerator(true);

		$tMap->addPrimaryKey('ID', 'Id', 'int', CreoleTypes::INTEGER, true, null);

		$tMap->addColumn('TITLE', 'Title', 'string', CreoleTypes::VARCHAR, true, 255);

		$tMap->addColumn('TITLE_LCASE', 'TitleLcase', 'string', CreoleTypes::VARCHAR, true, 255);

		$tMap->addForeignKey('IMAGE_ID', 'ImageId', 'int', CreoleTypes::INTEGER, 'image', 'ID', false, null);

		$tMap->addForeignKey('USER_ID', 'UserId', 'int', CreoleTypes::INTEGER, 'user', 'ID', false, null);

		$tMap->addColumn('QUANTITY', 'Quantity', 'int', CreoleTypes::INTEGER, false, null);

		$tMap->addColumn('QUANTITY_TYPE', 'QuantityType', 'string', CreoleTypes::VARCHAR, false, 16);

		$tMap->addColumn('QUANTITY_SIZE', 'QuantitySize', 'double', CreoleTypes::DOUBLE, false, null);

		$tMap->addColumn('IS_LIQUID', 'IsLiquid', 'boolean', CreoleTypes::BOOLEAN, false, null);

		$tMap->addColumn('KJ', 'Kj', 'double', CreoleTypes::FLOAT, false, null);

		$tMap->addColumn('PROTEIN', 'Protein', 'double', CreoleTypes::FLOAT, false, null);

		$tMap->addColumn('FAT_TOTAL', 'FatTotal', 'double', CreoleTypes::FLOAT, false, null);

		$tMap->addColumn('FAT_SATURATED', 'FatSaturated', 'double', CreoleTypes::FLOAT, false, null);

		$tMap->addColumn('CARBS', 'Carbs', 'double', CreoleTypes::FLOAT, false, null);

		$tMap->addColumn('CARBS_SUGARS', 'CarbsSugars', 'double', CreoleTypes::FLOAT, false, null);

		$tMap->addColumn('FIBRE', 'Fibre', 'double', CreoleTypes::FLOAT, false, null);

		$tMap->addColumn('SODIUM', 'Sodium', 'double', CreoleTypes::FLOAT, false, null);

		$tMap->addColumn('CREATED_AT', 'CreatedAt', 'int', CreoleTypes::TIMESTAMP, false, null);

		$tMap->addColumn('UPDATED_AT', 'UpdatedAt', 'int', CreoleTypes::TIMESTAMP, false, null);

	} 
} 